package com.luo.eduservice.controller;


import com.luo.eduservice.entity.EduTeacher;
import com.luo.eduservice.service.EduTeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 讲师 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-10-30
 */
@Api(description = "讲师管理")
@RestController
@RequestMapping("/eduservice/teacher")
public class EduTeacherController {

    @Autowired
    private EduTeacherService eduTeacherService;
    //查询所有
    @ApiOperation(value = "所有讲师列表")
    @GetMapping("fliAll")
    public List<EduTeacher> fliAll(){
        return eduTeacherService.list(null);
    }

    /**
     * 逻辑删除
     * @PathVariable ：这个注解是得到路径中的值
     *
     * */

    @DeleteMapping("{id}")
    @ApiOperation(value = "逻辑删除讲师")
    public boolean removeTeacher(@ApiParam(name="id",value = "讲师ID",required = true) @PathVariable String id){
        boolean b = eduTeacherService.removeById(id);
        return b;

    }
}

